package com.lwj.liwanjia.presenter;

import com.lwj.liwanjia.bean.DeleteAllBean;
import com.lwj.liwanjia.bean.DeleteBean;
import com.lwj.liwanjia.impl.DeleteGwcView;
import com.lwj.liwanjia.model.DeleteGwcModel;

import java.util.List;
import java.util.Map;

import rx.Subscriber;

/**
 * Created by Administrator on 2017/10/2.
 */

public class DeleteGwcPresenter {
    private DeleteGwcModel deleteGwcModel;
    private DeleteGwcView deleteGwcView;

    public DeleteGwcPresenter(DeleteGwcView deleteGwcView) {
        this.deleteGwcView = deleteGwcView;
        deleteGwcModel = new DeleteGwcModel();
    }

    public void deleteGwc(String token, DeleteAllBean deleteAllBean) {
        if (deleteGwcView != null) {
            deleteGwcModel.deleteGwc(token, deleteAllBean, new Subscriber<DeleteBean>() {
                @Override
                public void onCompleted() {

                }

                @Override
                public void onError(Throwable e) {
                    deleteGwcView.showError((Exception) e);
                }

                @Override
                public void onNext(DeleteBean deleteBean) {
                    deleteGwcView.deleteGwc(deleteBean);
                }
            });
        }
    }
}
